/**
 * Created by tom on 2017/3/10.
 */
const user = require('../models/user_model.js');

async function getUserInfo (ctx, next) {
  console.log(ctx.params);
  const id = ctx.params.id; // 获取url里传过来的参数里的id
  var result = await user.getUserById(id);
  ctx.body = result;
}

module.exports = {
  auth: (router) => {
    router.get('/user/:id', getUserInfo); // 定义url的参数是id
  }
};
